﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using OhioState.Graphics;

namespace OhioState.Controls
{
    public partial class FBOConfigDialog : Form
    {
        public FBOConfigDialog()
        {
            InitializeComponent();
            this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        public IFrameBufferObject CreateFBO()
        {
            IDepthBuffer depthBuffer = fboConfigControl1.DepthBuffer;
            FrameBufferClear clearFlags = fboConfigControl1.ClearFlags;
            IList<ITexture> textures = fboConfigControl1.Textures;
            // TODO: Add a name field to the FBOConfigControl
            string name = "NewFBO";
            IFrameBufferObject fbo = new FrameBufferObjectProxy(name, textures, depthBuffer, clearFlags);
            return fbo;
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
